.class Lcom/example/m6wmr/AskActivity$4;
.super Ljava/lang/Thread;
.source "AskActivity.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/example/m6wmr/AskActivity;->saveask()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lcom/example/m6wmr/AskActivity;


# direct methods
.method constructor <init>(Lcom/example/m6wmr/AskActivity;)V
    .locals 0

    .prologue
    .line 1
    iput-object p1, p0, Lcom/example/m6wmr/AskActivity$4;->this$0:Lcom/example/m6wmr/AskActivity;

    .line 148
    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 15

    .prologue
    const/4 v14, 0x1

    .line 150
    invoke-super {p0}, Ljava/lang/Thread;->run()V

    .line 151
    iget-object v11, p0, Lcom/example/m6wmr/AskActivity$4;->this$0:Lcom/example/m6wmr/AskActivity;

    .line 152
    const-string v12, "userInfo"

    const/4 v13, 0x0

    .line 151
    invoke-virtual {v11, v12, v13}, Lcom/example/m6wmr/AskActivity;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v6

    .line 153
    .local v6, "preferences":Landroid/content/SharedPreferences;
    const-string v11, "uid"

    const-string v12, ""

    invoke-interface {v6, v11, v12}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 154
    .local v0, "account":Ljava/lang/String;
    const-string v11, "username"

    const-string v12, ""

    invoke-interface {v6, v11, v12}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v10

    .line 155
    .local v10, "username":Ljava/lang/String;
    const-string v11, "pass"

    const-string v12, ""

    invoke-interface {v6, v11, v12}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    .line 156
    .local v7, "pwd":Ljava/lang/String;
    new-instance v5, Landroid/os/Message;

    invoke-direct {v5}, Landroid/os/Message;-><init>()V

    .line 158
    .local v5, "msg":Landroid/os/Message;
    iget-object v11, p0, Lcom/example/m6wmr/AskActivity$4;->this$0:Lcom/example/m6wmr/AskActivity;

    const v12, 0x7f0c001e

    invoke-virtual {v11, v12}, Lcom/example/m6wmr/AskActivity;->findViewById(I)Landroid/view/View;

    move-result-object v3

    check-cast v3, Landroid/widget/EditText;

    .line 160
    .local v3, "editText1":Landroid/widget/EditText;
    invoke-virtual {v3}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v11

    invoke-interface {v11}, Landroid/text/Editable;->toString()Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v11}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v11

    .line 161
    const-string v12, "%"

    const-string v13, ""

    invoke-virtual {v11, v12, v13}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v11

    const-string v12, " "

    const-string v13, ""

    invoke-virtual {v11, v12, v13}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v1

    .line 164
    .local v1, "content":Ljava/lang/String;
    const-string v11, ""

    invoke-virtual {v1, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v11

    if-eqz v11, :cond_0

    .line 165
    invoke-static {}, Lmyapp/Util;->dismisDialog()V

    .line 166
    const-string v11, "\u7559\u8a00\u5185\u5bb9\u4e3a\u7a7a"

    iput-object v11, v5, Landroid/os/Message;->obj:Ljava/lang/Object;

    .line 167
    iput v14, v5, Landroid/os/Message;->arg1:I

    .line 168
    iget-object v11, p0, Lcom/example/m6wmr/AskActivity$4;->this$0:Lcom/example/m6wmr/AskActivity;

    iget-object v11, v11, Lcom/example/m6wmr/AskActivity;->h:Landroid/os/Handler;

    invoke-virtual {v11, v5}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    .line 200
    :goto_0
    return-void

    .line 172
    :cond_0
    new-instance v11, Ljava/lang/StringBuilder;

    iget-object v12, p0, Lcom/example/m6wmr/AskActivity$4;->this$0:Lcom/example/m6wmr/AskActivity;

    iget-object v12, v12, Lcom/example/m6wmr/AskActivity;->m:Lmyapp/MyApp;

    invoke-virtual {v12}, Lmyapp/MyApp;->getWebConfig()Ljava/lang/String;

    move-result-object v12

    invoke-static {v12}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v12

    invoke-direct {v11, v12}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    .line 173
    const-string v12, "/index.php?ctrl=app&action=saveask&uid="

    invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    .line 174
    invoke-virtual {v11, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    const-string v12, "&pwd="

    invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    invoke-virtual {v11, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    const-string v12, "&content="

    invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    invoke-virtual {v11, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    const-string v12, "&datatype=json"

    invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    .line 172
    invoke-virtual {v11}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v9

    .line 175
    .local v9, "url":Ljava/lang/String;
    const-string v11, "AskActivity"

    new-instance v12, Ljava/lang/StringBuilder;

    const-string v13, "\u63d0\u4ea4\u7559\u8a00"

    invoke-direct {v12, v13}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v12, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v12

    invoke-virtual {v12}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v12

    invoke-static {v11, v12}, Lmyapp/Mylog;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 177
    iget-object v11, p0, Lcom/example/m6wmr/AskActivity$4;->this$0:Lcom/example/m6wmr/AskActivity;

    iget-object v11, v11, Lcom/example/m6wmr/AskActivity;->m:Lmyapp/MyApp;

    invoke-static {v9, v11}, LPlugclass/HttpConn;->getStr(Ljava/lang/String;Lmyapp/MyApp;)Ljava/lang/String;

    move-result-object v8

    .line 181
    .local v8, "str":Ljava/lang/String;
    :try_start_0
    new-instance v4, Lorg/json/JSONObject;

    invoke-direct {v4, v8}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 182
    .local v4, "json":Lorg/json/JSONObject;
    const-string v11, "error"

    invoke-virtual {v4, v11}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v11

    const-string v12, "true"

    invoke-virtual {v11, v12}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v11

    if-eqz v11, :cond_1

    .line 183
    invoke-static {}, Lmyapp/Util;->dismisDialog()V

    .line 185
    const-string v11, "msg"

    invoke-virtual {v4, v11}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v11

    iput-object v11, v5, Landroid/os/Message;->obj:Ljava/lang/Object;

    .line 186
    const/4 v11, 0x1

    iput v11, v5, Landroid/os/Message;->arg1:I

    .line 187
    iget-object v11, p0, Lcom/example/m6wmr/AskActivity$4;->this$0:Lcom/example/m6wmr/AskActivity;

    iget-object v11, v11, Lcom/example/m6wmr/AskActivity;->h:Landroid/os/Handler;

    invoke-virtual {v11, v5}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 193
    .end local v4    # "json":Lorg/json/JSONObject;
    :catch_0
    move-exception v2

    .line 195
    .local v2, "e":Lorg/json/JSONException;
    invoke-virtual {v2}, Lorg/json/JSONException;->printStackTrace()V

    .line 196
    const/4 v11, 0x4

    iput v11, v5, Landroid/os/Message;->arg1:I

    .line 197
    invoke-static {}, Lmyapp/Util;->dismisDialog()V

    .line 198
    iget-object v11, p0, Lcom/example/m6wmr/AskActivity$4;->this$0:Lcom/example/m6wmr/AskActivity;

    iget-object v11, v11, Lcom/example/m6wmr/AskActivity;->h:Landroid/os/Handler;

    invoke-virtual {v11, v5}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    goto/16 :goto_0

    .line 190
    .end local v2    # "e":Lorg/json/JSONException;
    .restart local v4    # "json":Lorg/json/JSONObject;
    :cond_1
    const/4 v11, 0x2

    :try_start_1
    iput v11, v5, Landroid/os/Message;->arg1:I

    .line 191
    invoke-static {}, Lmyapp/Util;->dismisDialog()V

    .line 192
    iget-object v11, p0, Lcom/example/m6wmr/AskActivity$4;->this$0:Lcom/example/m6wmr/AskActivity;

    iget-object v11, v11, Lcom/example/m6wmr/AskActivity;->h:Landroid/os/Handler;

    invoke-virtual {v11, v5}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
    :try_end_1
    .catch Lorg/json/JSONException; {:try_start_1 .. :try_end_1} :catch_0

    goto/16 :goto_0
.end method

.method public declared-synchronized start()V
    .locals 1

    .prologue
    .line 205
    monitor-enter p0

    :try_start_0
    invoke-super {p0}, Ljava/lang/Thread;->start()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 206
    monitor-exit p0

    return-void

    .line 205
    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method
